<?php 
require_once (__DIR__ . "/../../models/PaymentMethods.php");
require_once (__DIR__ . "/../../models/Users.php");
require_once (__DIR__ . "/../../models/Keywords.php");
$results = PaymentMethods::GetAll();

?>
				<a href="<?= "$rootUrl/../W/PaymentMethods/create"?>"><b>Add...</b></a>
				<table class="table table-bordered table-condensed table-hover table-striped">
					<tr>
						<th>Payment Type</th><th>Account Type</th><th>User Id</th><th>Actions</th>
					</tr>
					
					<?php while($row = $results->fetch_assoc()): ?>
						<?php $user = Users::Get($row['userId']); ?>
						<tr>
							<td><?php echo Keywords::GetName($row['paymentType']); ?></td> 
							<td><?php echo Keywords::GetName($row['accountType']);?> </td>
							<td><?php echo $user['firstName'].' '.$user['lastName'];?> </td>
							<td>
								<a href="<?= "$rootUrl/../W/PaymentMethods/details/$row[id]";?>">Details</a>
								<a href="<?= "$rootUrl/../W/PaymentMethods/edit/$row[id]";?>">Edit</a>
								<a href="<?= "$rootUrl/../W/PaymentMethods/delete/$row[id]";?>">Delete</a>
							</td>					
						</tr>
					<?php endwhile; ?>
					
				</table>